﻿@model ProductModel

@{
    var gridViewData = new ViewDataDictionary(this.ViewData);
    if (Model.Id > 0)
    {
        gridViewData["Parent"] = Model;
    }
}

@*INFO: Entities are switched. RelatedProducts are labeled with Cross-Selling & CrossSells are labeled with Checkout-Selling*@

<div>
    <h5 class="text-muted">@T("Admin.Catalog.Products.RelatedProducts")</h5>
    @if (Model.Id > 0)
    {
        <div class="mt-4">
            <partial name="Grids/_Grid.RelatedProducts" model="null" view-data="gridViewData" />
        </div>
    }
    else
    {
        <div class="alert alert-danger">
            @T("Admin.Catalog.Products.RelatedProducts.SaveBeforeEdit")
        </div>
    }
</div>

<div class="mt-5">
    <h5 class="text-muted">@T("Admin.Catalog.Products.CrossSells")</h5>

    @if (Model.Id > 0)
    {
        <div class="mt-4">
            <partial name="Grids/_Grid.CrossSellProducts" model="null" view-data="gridViewData" />
        </div>
    }
    else
    {
        <div class="alert alert-danger">
            @T("Admin.Catalog.Products.CrossSells.SaveBeforeEdit")
        </div>
    }
</div>